home *** CD-ROM | disk | FTP | other *** search
Text File | 1987-09-14 | 1.1 KB | 42 lines | [TEXT/MPS ] |
- ### MPW command "man" for on-line help
- ### Written 1987 W.G. Powell
- ### for MacTutor
- ### Search more than one file sequentially for help text
-
- Set Exit 0
- Set Reval 0
- ### Get standard command names from alias dictionary
- # need temporary file
- Set _dmfl_ dumrxfx_
- # Unalias the input arguments
- Echo {Parameters} | Canon "{MPW}billTools:Alias.Dict" > "{_dmfl_}"
- # Set new input arguments
- Set HelpList "`Catenate {_dmfl_}`"
- Delete -n {_dmfl_}
- ### Look for each requested item individually
- For HelpItem In {HelpList}
- # Look in default help file first
- Help {HelpItem} ≥ Dev:Null
- Set Retval {Status}
- If ({Retval} == 2 || {Retval} == 1)
- # Look in local help file if not in default
- Help -f "{MPW}Local.Help" {HelpItem} ≥ Dev:Null
- Set Retval {Status}
- End
- If ({Retval} != 0)
- # Keep a list of items NOT found for diagnostic
- Set Reval {Retval}
- Set NotFnd "{NotFnd} {HelpItem}"
- End
- End
- ### Send error message if items not found.
- If ({Reval} != 0)
- Echo "### Help: Cannot find items:">Dev:StdErr
- Echo "### {NotFnd}">Dev:StdErr
- End
- Unset NotFnd
- Unset _dmfl_
- Unset HelpItem
- Unset HelpList
- Unset Retval
- Exit {Reval}